#include <vector>
#include "structs.h"

class Profile
{
public:
    unsigned int * frequencies;                         //table reused for whole reference sequence
    unsigned int * tableX;                              //table containing the x axis
    unsigned int * tableY;                              //table containing the y axis
    char * sequence;                                    //reference sequence
    int sequence_len;                                   //length of reference sequence
    unsigned short int k;                               //size of k-mer
    unsigned int size;                                  //4^k
    unsigned short read_size;                           //size of read (if doing whole genome)
    bool circular;                                      //true if genome is circular, false if linear

    Profile(unsigned short int kmer_size, int r, char * x, char * y);             //for genomes, file_name is file of files, refr_num is which reference (and alts to do)
    ~Profile();

    unsigned int get_coordinates_genome(char * file_name, int refr_num, coordinates *& c);                                      //coordinates
    unsigned int get_centroids_genome(char * file_name, int refr_num, centroid *& c);
    unsigned int get_centroids_genome(char * file_name, int refr_num, std::vector<centroid> & c);
    unsigned int get_centroids_genome(char * file_name, std::vector<centroid> & c);
    bool examine_read(char * read_seq, coordinates &c);



private:
    bool calc_freqs(unsigned int start, unsigned int end);                                          //calculates the frequencies over sequence
    float correlation(int axis);                                                                    //calculates correlation between sequence/reads and axis
    float all_correlations();                                                                       //calculates correlation for all fake reads in genome
    bool load_axis(char * file_name, int axis);                                                     //loads frequency table for reference axis from file
    bool get_sequence(char * file_name);                                                            //loads sequence and sets sequence_len
    bool get_coordinate_read(coordinates & c);                     //gets coordinates for reads
    unsigned int  get_coordinates_genome(std::vector<float> & x, std::vector<float> & y);                    //gets coordinates for sequences
    unsigned int  get_centroids_genome(std::vector<float> & x, std::vector<float> & y, std::vector<float> & prob);                    //gets coordinates for sequences
    unsigned int  get_centroids_genome(std::vector<centroid> & c);                    //gets coordinates for sequences
    bool add_read(char * read_seq);
};
